<% layout('/layouts/default.html', {title: '保证金预收', libs: ['validate']}){ %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<#form:form id="inputForm" model="${finServiceOrder}" action="${ctx}/financing/finserviceorder/finServiceOrder/saveFinAdFrom" method="post" class="form-horizontal">
<#form:hidden path="financingServiceOrderId"/>
<div class="col-xs-6">
    <div class="form-group">
        <label class="control-label col-sm-4" title="">
            <span class="required hide">*</span> ${text('单据类型')}：<i class="fa icon-question hide"></i></label>
        <div class="col-sm-8">
            <#form:select path="erpRecordType" dictType="erp_record_type" blankOption="true" class="form-control" readonly="true" />
            <input type="hidden" name="erpRecordType" value="releasecar002">
        </div>
    </div>
</div>
<div class="col-xs-6">
    <div class="form-group">
        <label class="control-label col-sm-4" title="">
            <span class="required hide">*</span> ${text('阶段')}：<i class="fa icon-question hide"></i></label>
        <div class="col-sm-8">
            <#form:select path="advance" dictType="advance_jieduan" blankOption="true" class="form-control" readonly="true" />
            <input type="hidden" name="gridRowId" value="">
        </div>
    </div>
</div>
<div class="col-xs-6">
    <div class="form-group">
        <label class="control-label col-sm-4" title="">
            <span class="required hide">*</span> ${text('预收额')}：<i class="fa icon-question hide"></i></label>
        <div class="col-sm-8">
            <#form:input path="money"  blankOption="true" class="form-control" readonly="true" />
        </div>
    </div>
</div>
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
</#form:form>
</body>
</html>
<% } %>
<script>
    $("#inputForm").validate({
        submitHandler: function(form){
            js.ajaxSubmitForm($(form), function(data){
                js.showMessage(data.message);
                if(data.result == Global.TRUE){
                    js.closeCurrentTabPage(function(contentWindow){
                        contentWindow.page();
                    });
                }
            }, "json");
        }
    });
    var gridRowId="${finServiceOrder.gridRowId}";
    $(function () {
        $('#erpRecordType').val('releasecar002').trigger('change');
        $('#advance').val(gridRowId).trigger('change');
        $("input[name='gridRowId']").val(gridRowId);
    })
</script>